Skip to content

UIP-52 fix integration tests#3652

Merged
briehl merged 3 commits intodevelopfrom
UIP-52-fix-integration-tests
Sep 5, 2024
Merged

UIP-52 fix integration tests#3652
briehl merged 3 commits intodevelopfrom
UIP-52-fix-integration-tests

Conversation

@briehl
Copy link
Copy Markdown
Member

@briehl briehl commented Sep 4, 2024

STILL IN PROGRESS - DO NOT MERGE YET

Description of PR purpose/changes

Fix up the broken integration tests. They've failed due to a combination of out-of-date dependencies, a bug or two, and inaccessible test narratives.

I've changed relevant narratives to be accessible (or at least viewable) by the narrative_test CI account. So they should all work ok with a narrative_test auth token, which should be a GH secret.

Here's the changes:

  • updated to latest chromedriver and puppeteer (still the standard for installing headless chrome)
  • fixed bug in public data view where the number of contigs and features for NCBI ref genomes wasn't being shown properly
  • updated the narrative in the featureset viewer test to a new one owned by narrative_test
  • made other narratives viewable by the narrative_test account (TODO: remake these under narrative_test)

Jira Ticket / Issue

Related Jira ticket: https://kbase-jira.atlassian.net/browse/UIP-52

  • Added the Jira Ticket to the title of the PR (e.g. DATAUP-69 Adds a PR template)

Testing Instructions

  • Details for how to test the PR:
  • Tests pass locally and in GitHub Actions
  • Changes available by spinning up a local narrative and navigating to X to see Y

Dev Checklist:

  • My code follows the guidelines at https://sites.google.com/lbl.gov/trussresources/home?authuser=0
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • (JavaScript) I have run Prettier and ESLint on changed code manually or with a git precommit hook
  • [n/a] (Python) I have run Ruff format and check on changed Python code manually or with a git precommit hook
  • Any dependent changes have been merged and published in downstream modules

Updating Version and Release Notes (if applicable)

options = defaultValue;
defaultValue = undefined;
}
let missing = false;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hunk of code here tests if the string passed in for processing is a number in various ways. We're using the numeral package here, so just let it tell us. Also, the real bug was using isNaN on the numeralValue object, which was erroring. Not sure why this took so long to fail / be found.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure it's the only unfound bug in the codebase!

Comment thread scripts/run_tests.sh
"/kb/dev_container/narrative/src/config.json.templ:/kb/dev_container/narrative/kbase-extension/static/kbase/config/config.json" \
kbase-narrative --no-browser --port=$JUPYTER_PORT 2>&1 | tee $OUTPUT_FILE &
bg_pid=$!
bg_pid=$(jobs -p)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests ongoing - I want to see how it behaves on GHA.
But when running on my local MacOS, $bg_pid had the pid of the tee process, not kbase-narrative. Running jobs -p fixes that.

Comment thread scripts/run_tests.sh
# }

# echo "Killing process $bg_pid and children"
pkill -P "$bg_pid"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're already using pgrep in kill_descendant_processes, so pkill should be available and basically does the same thing. I think.

}
]
},
{
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests seemed to be effectively redundant with slightly different data. They may be relevant, and just generated by different apps, but as far as the viewer's concerned, they seem to be similar enough.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 25.88%. Comparing base (f10fc2d) to head (e1768db).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3652      +/-   ##
===========================================
- Coverage    25.92%   25.88%   -0.04%     
===========================================
  Files          461      461              
  Lines        46652    46652              
===========================================
- Hits         12093    12078      -15     
- Misses       34559    34574      +15     

see 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d96b8e...e1768db. Read the comment docs.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Sep 5, 2024

@briehl briehl merged commit 7367997 into develop Sep 5, 2024
@briehl briehl deleted the UIP-52-fix-integration-tests branch September 5, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants